home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / comm / mebbs / fb.lha / fb.rexx < prev   
OS/2 REXX Batch file  |  1994-11-12  |  2KB  |  94 lines

  1. /* Build a FLO file by Larry Cloud M3001 */
  2.  
  3. start1:
  4. cls=" "
  5. say cls||"FLO Builder by Larry Cloud M3001"
  6. say "Enter address (4D) separated by spaces, example: 1 350 31 0"
  7. say "Or hit Q to abort."
  8. if zone ~="ZONE" then do
  9.  say "Or hit enter for "||zone||" "||net||" "||node||" "||point||"."
  10. end
  11. pull adr
  12. if adr="" & zone ~="ZONE" then signal start2
  13. if upper(adr)="Q" then signal getout
  14. parse var adr zone net node point junk
  15. if zone < 1 then signal start
  16. if net="" | node="" then signal start1
  17. if point="" then point="0"
  18. if exists("ram:nodeinfo") then do
  19.  address command "delete ram:nodeinfo quiet"
  20.  do i=1 to 1000;end
  21. end
  22. address command "findnode "||zone||":"||net||"/"||node||"."||point||" > ram:nodeinfo"
  23. do i=1 to 1000;end
  24. open(file,"ram:nodeinfo",'r')
  25. do i=1 to 5
  26. x=readln(file)
  27. end
  28. x=readln(file)
  29. if x~=" Data not found." then do
  30.  do i=1 to 4
  31.   x=readln(file)
  32.   say x
  33.  end
  34.  call close(file)
  35.  signal start2
  36. end
  37. call close(file)
  38. say "That address is invalid.  Please try again."
  39. zone="ZONE"
  40. signal start1
  41.  
  42.  
  43. start2:
  44. path="OUT:"
  45. say "Enter filename to add to the FLO (or hit ENTER to abort)"
  46. pull filename
  47. if filename="" then signal start5
  48. if exists("OUT:"||filename) then do
  49.  say"File '"||filename||"' already exists in OUT: use this path? (Y/n)"
  50.  pull question
  51.  question=upper(question)
  52.  if question="N" then do
  53.   signal start3
  54.  end
  55. signal start4
  56. end
  57.  
  58. start3:
  59. say "Enter FULL path to file (do NOT include file name, end path with : or /)"
  60. say "(or use Q to abort)"
  61. pull path
  62. path=upper(path)
  63. if path="Q" then signal start5
  64. if right(path,1) ~=":" & right(path,1)~="/" then signal start3
  65. if ~exists(path||filename) then do
  66.  say "File does NOT exist in that path.  Try again!"
  67.  signal start3
  68. end
  69.  
  70. start4:
  71. op="W"
  72. adrs=zone||"."||net||"."||node||"."||point||".FLO"
  73. if exists("OUT:"||adrs) then op="A"
  74. string="Creating new "
  75. if op="A" then string="Appending to "
  76. say string||"FLO file "||adrs
  77. open(file,"OUT:"||adrs,op)
  78. writeln(file,path||filename)
  79. close(file)
  80.  
  81. start5:
  82. say "Again? (Y/n)"
  83. pull question
  84. if upper(question)="N" then signal getout
  85. signal start1
  86.  
  87. getout:
  88. say "You've been using FLO Builder by Larry Cloud M3001"
  89. if exists("ram:nodeinfo") then do
  90.  address command "delete ram:nodeinfo quiet"
  91.  do i=1 to 1000;end
  92. end
  93. exit
  94.